package com.ruoyi.yipaiju.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.yipaiju.domain.HouseUploadingOrder;
import com.ruoyi.yipaiju.service.IHouseUploadingOrderService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * fo_house_uploading_orderController
 * 
 * @author liuwp
 * @date 2023-03-01
 */
@RestController
@RequestMapping("/yipaiju/house_uploading_order")
public class HouseUploadingOrderController extends BaseController
{
    @Autowired
    private IHouseUploadingOrderService houseUploadingOrderService;

    /**
     * 查询fo_house_uploading_order列表
     */
    @PreAuthorize("@ss.hasPermi('yipaiju:house_uploading_order:list')")
    @GetMapping("/list")
    public TableDataInfo list(HouseUploadingOrder houseUploadingOrder)
    {
        startPage();
        List<HouseUploadingOrder> list = houseUploadingOrderService.selectHouseUploadingOrderList(houseUploadingOrder);
        return getDataTable(list);
    }

    /**
     * 导出fo_house_uploading_order列表
     */
    @PreAuthorize("@ss.hasPermi('yipaiju:house_uploading_order:export')")
    @Log(title = "fo_house_uploading_order", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, HouseUploadingOrder houseUploadingOrder)
    {
        List<HouseUploadingOrder> list = houseUploadingOrderService.selectHouseUploadingOrderList(houseUploadingOrder);
        ExcelUtil<HouseUploadingOrder> util = new ExcelUtil<HouseUploadingOrder>(HouseUploadingOrder.class);
        util.exportExcel(response, list, "fo_house_uploading_order数据");
    }

    /**
     * 获取fo_house_uploading_order详细信息
     */
    @PreAuthorize("@ss.hasPermi('yipaiju:house_uploading_order:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(houseUploadingOrderService.selectHouseUploadingOrderById(id));
    }

    /**
     * 新增fo_house_uploading_order
     */
    @PreAuthorize("@ss.hasPermi('yipaiju:house_uploading_order:add')")
    @Log(title = "fo_house_uploading_order", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody HouseUploadingOrder houseUploadingOrder)
    {
        return toAjax(houseUploadingOrderService.insertHouseUploadingOrder(houseUploadingOrder));
    }

    /**
     * 修改fo_house_uploading_order
     */
    @PreAuthorize("@ss.hasPermi('yipaiju:house_uploading_order:edit')")
    @Log(title = "fo_house_uploading_order", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody HouseUploadingOrder houseUploadingOrder)
    {
        return toAjax(houseUploadingOrderService.updateHouseUploadingOrder(houseUploadingOrder));
    }

    /**
     * 删除fo_house_uploading_order
     */
    @PreAuthorize("@ss.hasPermi('yipaiju:house_uploading_order:remove')")
    @Log(title = "fo_house_uploading_order", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(houseUploadingOrderService.deleteHouseUploadingOrderByIds(ids));
    }
}
